package days26.title242;

/**
 * @Author fengzihao
 * @Date 2024-05-10 21:23
 */
class Solution {
    public boolean isAnagram(String s, String t) {
        if (s.length()!=t.length())
            return false;
        int[] Counts = new int[26];
        for (int i = 0; i < s.length(); i++) {
            Counts[s.charAt(i)-'a']++;
            Counts[t.charAt(i)-'a']--;
        }
        for (int i = 0; i < 26; i++) {
            if (Counts[i]!=0)
                return false;
        }
        return true;
    }
}
